//
//  SwitchViewController.h
//  PhotoFrame
//
//  Created by William on 11-5-5.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import "GlobalDelegate.h"

@class PhotoFramePortraitViewController;
@class PhotoFrameLandscapeViewController;
@class PhotoFrameFullScreenViewController;
@class PhotoFrameGroupViewController;
@class CalendarObjectDTO;
@interface SwitchViewController : UIViewController <GlobalDelegate> {
	PhotoFramePortraitViewController *portraitViewController;
	PhotoFrameLandscapeViewController *landscapeViewController;
	PhotoFrameFullScreenViewController *fullScreenViewController;
	CalendarObjectDTO * calendarObject;
    UIImage *viewImage;
	
	UIButton *togglePopoverButton;
	UIPopoverController *popoverController;
	
	NSTimer *photoPollingTimer;
	NSTimer *timePollingTimer;
	
	NSMutableDictionary *gblConf;
	NSArray *photoPathList;
    ALAsset *imageAsset;
	
	int currentFrame;
	//int index;
}

@property(retain, nonatomic) PhotoFramePortraitViewController *portraitViewController;
@property(retain, nonatomic) PhotoFrameLandscapeViewController *landscapeViewController;
@property(retain, nonatomic) PhotoFrameFullScreenViewController *fullScreenViewController;
@property(retain, nonatomic) PhotoFrameGroupViewController *groupViewController;
@property(retain, nonatomic) CalendarObjectDTO * calendarObject;
@property(assign, nonatomic) UIImage *viewImage;

@property(assign, nonatomic) IBOutlet UIButton *togglePopoverButton;
@property(retain, nonatomic) UIPopoverController *popoverController;

// timer for photo and time
@property (nonatomic, assign) NSTimer *photoPollingTimer;
@property (nonatomic, assign) NSTimer *timePollingTimer;

// global configuration for digital photo frame
@property(retain, nonatomic) NSMutableDictionary *gblConf;
@property(retain, nonatomic) NSArray *photoPathList;
@property(retain, nonatomic) ALAsset *imageAsset;
@property(retain, nonatomic) NSURL *imageURL;
@property(retain, nonatomic) UIImage *image;
@property (nonatomic, retain) ALAssetsLibrary *library;
@property(retain, nonatomic) NSString *playURL;

- (IBAction) togglePopover;

- (void) initGblConf;
- (void) initTimer;
- (void) refreshPhoto: (NSTimer *) newTimer;
- (void) loadImage;
- (void) initViewOrder: (int) order;
@end
